# __init__.py
#
# Copyright (c) 2006 Michael Hobbs
#
# This file is part of iTorrent.
#
# iTorrent is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# iTorrent is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with iTorrent; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA


from utils import addBitTorrentToSysPath
addBitTorrentToSysPath()

from BitTorrent.platform import install_translation
install_translation()

# Apply custom patches to the BitTorrent package here. The theory is that if we
# apply run-time patches instead of apply patches to the source directly, we can
# more easily integrate with new versions of BitTorrent.
import BitTorrent.PiecePicker
from BitTorrent_patches.PiecePicker import patched_PiecePicker
BitTorrent.PiecePicker.PiecePicker = patched_PiecePicker

import BitTorrent.StorageWrapper
from BitTorrent_patches.StorageWrapper import patched_StorageWrapper
BitTorrent.StorageWrapper.StorageWrapper = patched_StorageWrapper

import BitTorrent.defaultargs
from BitTorrent_patches.defaultargs import patched_basic_options, patched_common_options, patched_rare_options
BitTorrent.defaultargs.basic_options = patched_basic_options
BitTorrent.defaultargs.common_options = patched_common_options
BitTorrent.defaultargs.rare_options = patched_rare_options
